function idx = find_closest(vector, value)

% this function finds the index of the entry in 'vector' that is closest to
% 'value'

tmp = abs(vector - value); 

[closest idx] = min(tmp); 



